<template>
  <div class="back-box">
    <div class="tip-box" @click="back">
      <van-icon name="arrow-left" size=".5rem" />
      <p class="back">返回</p>
    </div>
    <div class="title">
      {{ title }}
    </div>
  </div>
</template>
<script setup>
import { useRouter } from "vue-router";

const router = useRouter();
function back() {
  router.back()
}
defineProps({
  title: {
    type: String,
    default: "",
  },
});
</script>

<style lang="less" scoped>
.back {
  display: inline;
  margin-left: 5px;
  font-size: 18px;
  font-weight: 500;
}
.back-box {
  padding: 10px;
  position: relative;

  /deep/.tip-box {
    height: 30px;
    width: 60px;
    line-height: 30px;
  }
  .title {
    font-size: 18px;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
  }
}
</style>
